<table cellspacing="0" cellpadding="0">
  <tr>
    <?php
	$curpage = '';
    if(isset($_GET['page']))
    {
        $curpage = $_GET['page'];
    }
	$pagelist = $pages->pagelist();
	foreach($pagelist as $item)
        {
		$id = $item[0];
		$name = $item[1];
		$title = $item[2];
		$body = $item[3];
		if($name == $curpage)
		{
			?><td height="152" width="125" class="button_active"><?php echo $title;?></td><?php
		}
		else
		{
			?>
			<td height="152" width="125" class="button_inactive">
                <a id="page" href="/pages.php?page=<?php echo $name;?>">
                <?php echo $title;?></a>
            </td>
			<?php
		}
        }
?>
</tr>
</table>
